<!-- 多台开席调整 - 弹窗组件 -->
<template>
  <CustomDialog v-model:visible="dialogVisible" top="5vh" width="80%">
    <div class="dialog-content" v-if="isShowDesktopType">
      <div class="title">选择开台方式</div>
      <div class="btn-box">
        <div class="cancel-btn" @click="handleConfirm(10)">酒席方式</div>
        <div class="confirm-btn" @click="handleConfirm(20)">散点方式</div>
      </div>
    </div>
    <div class="mulOpeningDesktopDialog-box" v-else>
      <div class="left-box">
        <div class="title" v-if="actionType === 'mulOpening'">多台开席</div>
        <div class="title" v-else>多台开席调整</div>
        <div class="paging-list-box" v-loading="categoryLoading">
          <div
            class="paging-list-item"
            :class="{ 'paging-list-item-active': pagingActiveIndex === pagingIndex }"
            @click="handleSelectPaging(pagingIndex, pagingItem)"
            v-for="(pagingItem, pagingIndex) in desktopCategoryList"
            :key="pagingItem.id + pagingItem.name + pagingIndex"
          >
            <el-tooltip class="item" effect="dark" :content="pagingItem.name" placement="top">
              <div class="name">{{ pagingItem.name }}</div>
            </el-tooltip>
          </div>
          <div class="paging-list-btn">
            <el-button
              class="left-btn"
              @click.stop="oneCatePreviousPage"
              icon="ArrowLeft"
              circle
              plain
            />
            <el-button
              class="right-btn"
              @click.stop="oneCateNextPage"
              icon="ArrowRight"
              circle
              plain
            />
          </div>
        </div>

        <div class="room-content-box" v-loading="listLoading">
          <div class="room-scroll-list" v-if="!isEmptyDesktopIdleList">
            <div
              class="scroll-list-item"
              v-for="(desk, index) in desktopIdleList"
              :key="desk.id + index"
              @click="handleSelectTable(index, desk)"
              :style="{
                'border-color':
                  desk &&
                  desk.is_use &&
                  desk.is_use.value === 1 &&
                  desk.recordInfo &&
                  desk.recordInfo.status &&
                  desk.recordInfo.status.value
                    ? deskOrderStatus[desk.recordInfo.status.value]
                    : deskUseStatus[desk.is_use.value]
              }"
            >
              <div
                class="title-box"
                :style="{
                  background:
                    desk &&
                    desk.is_use &&
                    desk.is_use.value === 1 &&
                    desk.recordInfo &&
                    desk.recordInfo.status &&
                    desk.recordInfo.status.value
                      ? deskOrderStatus[desk.recordInfo.status.value]
                      : deskUseStatus[desk.is_use.value]
                }"
              >
                <div
                  class="name"
                  v-if="
                    desk &&
                    desk.is_use &&
                    desk.is_use.value === 1 &&
                    desk.recordInfo &&
                    desk.recordInfo.status &&
                    desk.recordInfo.status.value
                  "
                >
                  {{ deskStatusText[desk.recordInfo.status.value] }}
                </div>
                <div class="name" v-else>{{ desk.is_use.text }}</div>
                <div class="count">
                  <span v-if="desk && desk.hadRecordList && desk.recordInfo">
                    {{ desk.recordInfo.use_num || '0' }}</span
                  >
                  <span v-else>{{ desk.use_num || '0' }}</span
                  >/<span>{{ desk.capacity }}人</span>
                </div>
              </div>
              <div class="desc-box">
                <div class="numberAndTag">
                  <el-tooltip class="item" effect="dark" :content="desk.name" placement="top">
                    <div class="number">{{ desk.name }}</div>
                  </el-tooltip>
                  <div class="tag" v-if="desk && desk.recordInfo && desk.recordInfo.recordType">
                    {{ desk.recordInfo.recordType }}
                  </div>
                </div>
              </div>
              <!-- 选中桌台的图片 -->
              <el-icon v-show="desk.isChecked" class="choose-img"><Select /></el-icon>
            </div>
          </div>

          <!-- 暂无数据的组件 -->
          <div class="no-data-box" v-if="isEmptyDesktopIdleList">
            <el-empty description="暂无桌台数据" />
          </div>
        </div>
        <div class="count-choose-box" v-if="!isEmptyDesktopIdleList">
          <div class="total">共{{ desktopIdleListTotal }}台</div>
        </div>
      </div>
      <div class="right-box">
        <div class="title">开席桌台</div>
        <div class="desktop-form-box">
          <!-- 已选中的桌台 -->
          <div class="room-selected-box">
            <div class="room-selected-scroll-list" v-if="selectDeskActiveList.length">
              <div
                class="scroll-selected-list-item"
                v-for="(desk, index) in selectDeskActiveList"
                :key="desk.id + desk.name + index"
                :style="{
                  'border-color':
                    desk &&
                    desk.is_use &&
                    desk.is_use.value === 1 &&
                    desk.recordInfo &&
                    desk.recordInfo.status &&
                    desk.recordInfo.status.value
                      ? deskOrderStatus[desk.recordInfo.status.value]
                      : deskUseStatus[desk.is_use.value]
                }"
              >
                <div
                  class="title-box"
                  :style="{
                    background:
                      desk &&
                      desk.is_use &&
                      desk.is_use.value === 1 &&
                      desk.recordInfo &&
                      desk.recordInfo.status &&
                      desk.recordInfo.status.value
                        ? deskOrderStatus[desk.recordInfo.status.value]
                        : deskUseStatus[desk.is_use.value]
                  }"
                >
                  <div
                    class="name"
                    v-if="
                      desk &&
                      desk.is_use &&
                      desk.is_use.value === 1 &&
                      desk.recordInfo &&
                      desk.recordInfo.status &&
                      desk.recordInfo.status.value
                    "
                  >
                    {{ deskStatusText[desk.recordInfo.status.value] }}
                  </div>
                  <div class="name" v-else>{{ desk.is_use.text }}</div>
                  <div class="count">
                    <span v-if="desk && desk.hadRecordList && desk.recordInfo">
                      {{ desk.recordInfo.use_num || '0' }}</span
                    >
                    <span v-else>{{ desk.use_num || '0' }}</span
                    >/<span>{{ desk.capacity }}人</span>
                  </div>
                </div>
                <div class="desc-box">
                  <div class="numberAndTag">
                    <el-tooltip class="item" effect="dark" :content="desk.name" placement="top">
                      <div class="number">{{ desk.name }}</div>
                    </el-tooltip>
                    <div class="tag" v-if="desk && desk.recordInfo && desk.recordInfo.recordType">
                      {{ desk.recordInfo.recordType }}
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <!-- 暂无数据的组件 -->
            <div class="no-data-box-two" v-else>
              <el-empty description="暂无桌台数据" />
            </div>
          </div>
          <div class="count-selected-box">
            <div class="total" v-if="selectDeskActiveList.length">
              已选{{ selectDeskActiveList.length }}台
            </div>
          </div>
          <!-- 表单区域 -->
          <div class="form-input-box">
            <div class="form-item">
              <div class="desc">人数</div>
              <div class="dialog-input">
                <input
                  class="input"
                  v-model.trim="peopleKeyword"
                  type="number"
                  placeholder="请输入人数"
                  @focus="onInputFocus($event, 'peopleKeyword', peopleKeyword)"
                  :min="1"
                />
                <el-icon
                  class="image"
                  @click="handleClearInput('peopleKeyword')"
                  v-if="peopleKeyword"
                >
                  <CircleClose />
                </el-icon>
              </div>
            </div>
            <div class="form-item" v-if="settleType === 10">
              <div class="desc">单席金额</div>
              <div class="dialog-input">
                <input
                  class="input"
                  v-model.trim="moneyKeyword"
                  type="number"
                  placeholder="请输入单席金额"
                  @focus="onInputFocus($event, 'moneyKeyword', moneyKeyword)"
                  :min="1"
                />
                <el-icon
                  class="image"
                  @click="handleClearInput('moneyKeyword')"
                  v-if="moneyKeyword"
                >
                  <CircleClose />
                </el-icon>
              </div>
            </div>
            <div class="form-item">
              <div class="desc">席数</div>
              <div class="dialog-input">
                <input
                  class="input"
                  v-model.trim="desktopKeyword"
                  type="number"
                  placeholder="请输入席数"
                  @focus="onInputFocus($event, 'desktopKeyword', desktopKeyword)"
                  :min="1"
                />
                <el-icon
                  class="image"
                  @click="handleClearInput('desktopKeyword')"
                  v-if="desktopKeyword"
                >
                  <CircleClose />
                </el-icon>
              </div>
            </div>
          </div>

          <!-- 数字键盘组件 -->
          <div class="number-keyword-box">
            <!-- 数字键盘 -->
            <NumberKeyboard
              v-model:keyword="currentInputVal"
              @onInputKeyboard="onInputKeyboard"
              @onCancel="handleClearInput"
              @onConfirm="onConfirm"
              :loading="loading"
            />
          </div>
        </div>
      </div>
    </div>
  </CustomDialog>
</template>

<script setup lang="ts">
import { ref, computed, watch } from 'vue'
import { ElMessage } from 'element-plus'
import { ArrowLeft, ArrowRight, Select, CircleClose } from '@element-plus/icons-vue'
import CustomDialog from '@/components/CustomDialog/Index.vue'
import NumberKeyboard from '@/components/NumberKeyboard/Index.vue'
import {
  fetchDeskList,
  fetchCategoryList,
  openMostDesk,
  deskMultipleRecordList,
  deskEditMostDesk
} from '@/api/desktop'
import { isEmpty } from '@/utils/toolsValidate'
import { DESK_USE_STATUS, DESK_ORDER_STATUS, DESK_STATUS_TEXT } from '@/constants/desktopStatus'

interface Props {
  modelValue: boolean
  actionType?: string
  isShowType?: boolean
  deskDetail?: any
}

interface Emits {
  (e: 'update:modelValue', value: boolean): void
  (e: 'success'): void
}

const props = withDefaults(defineProps<Props>(), {
  modelValue: false,
  actionType: 'adjust',
  isShowType: true,
  deskDetail: null
})

const emit = defineEmits<Emits>()

// 对话框显示状态
const dialogVisible = computed({
  get: () => props.modelValue,
  set: val => emit('update:modelValue', val)
})

// 当前桌台详情
const currentDeskDetail = computed(() => props.deskDetail)

// 是否显示选择开台方式的弹窗
const isShowDesktopType = ref(false)

// 桌台分类的分页专用索引
const pagingActiveIndex = ref(0)

// 人数关键字
const peopleKeyword = ref('')

// 单席金额关键字
const moneyKeyword = ref('')

// 席数关键字
const desktopKeyword = ref('')

// 桌台列表相关查询数据
const mulOpeningDesktopQuery = ref({
  // 桌台状态，只筛选空闲中的桌台
  is_use: 0,
  // 分类id
  category_id: null as number | null
})

// 选中对应桌台的索引下标
const selectDeskActiveIndex = ref(-1)

// 桌台列表数据【空闲的】
const desktopIdleList = ref<any[]>([])

// 桌台列表数据总条数
const desktopIdleListTotal = ref(0)

// 列表为空是否暂无数据
const isEmptyDesktopIdleList = ref(false)

// 桌台分类列表
const desktopCategoryList = ref<any[]>([])

// 已经选中的桌台列表
const selectDeskActiveList = ref<any[]>([])

// 结算方式  10:酒席方式    20：散点方式
const settleType = ref<number | null>(null)

// 结算方式枚举数组
const settleTypeOptions = [
  {
    value: 10,
    label: '酒席方式'
  },
  {
    value: 20,
    label: '散点方式'
  }
]

// 判断目前聚焦在哪个input输入框
const inputFocusType = ref<string | null>(null)

// 获取当前聚焦的input的值
const currentInputVal = ref('')

// 桌台分类列表分页相关
const deskCategoryPageQuery = ref({
  // 一级分类的分页
  page: 1,
  limit: 4
})

// 判断一级分类是否还能继续下一页操作分页
const deskOneCategoryLastPage = ref(0)

// 桌台的使用状态颜色的颜色枚举
const deskUseStatus = DESK_USE_STATUS

// 桌台的的使用中下面的菜单状态颜色枚举
const deskOrderStatus = DESK_ORDER_STATUS

// 桌台的的使用中下面的菜单状态文字枚举
const deskStatusText = DESK_STATUS_TEXT

// 加载状态
const loading = ref(false)

// 桌台列表加载状态
const listLoading = ref(false)

// 获取桌台列表数据
const getDeskListData = async () => {
  listLoading.value = true
  try {
    const res = await fetchDeskList(mulOpeningDesktopQuery.value)
    if (res.status === 200 && !isEmpty(res?.data)) {
      res.data.forEach((item: any) => {
        item.isChecked = false
      })
      desktopIdleList.value = res.data
      desktopIdleListTotal.value = res.data.length
      isEmptyDesktopIdleList.value = res.data.length === 0
    }
  } catch (error) {
    console.error('获取桌台列表失败:', error)
    ElMessage.error('获取桌台列表失败')
  } finally {
    listLoading.value = false
  }
}

// 分类列表加载状态
const categoryLoading = ref(false)

// 获取桌台分类列表数据
const getCategoryListData = async () => {
  categoryLoading.value = true
  if (deskCategoryPageQuery.value.page === 1) {
    deskCategoryPageQuery.value.limit = 4
  } else {
    deskCategoryPageQuery.value.limit = 5
  }
  try {
    const res = await fetchCategoryList(deskCategoryPageQuery.value)
    if (res.status === 200 && !isEmpty(res?.data?.data)) {
      deskOneCategoryLastPage.value = res.data.last_page
      if (deskCategoryPageQuery.value.page === 1) {
        res.data.data.unshift({
          id: 0,
          name: '全部'
        })
      }
      desktopCategoryList.value = res.data.data
    }
  } catch (error) {
    console.error('获取桌台分类列表失败:', error)
    ElMessage.error('获取桌台分类列表失败')
  } finally {
    categoryLoading.value = false
  }
}

// 一级分类上一页操作
const oneCatePreviousPage = () => {
  if (deskCategoryPageQuery.value.page === 1) return
  deskCategoryPageQuery.value.page -= 1
  // 重置一级分类索引和桌台列表分页
  resetOneCate()
  getCategoryListData()
}

// 一级分类下一页操作
const oneCateNextPage = () => {
  if (deskCategoryPageQuery.value.page >= deskOneCategoryLastPage.value) return
  deskCategoryPageQuery.value.page += 1
  // 重置一级分类索引和桌台列表分页
  resetOneCate()
  getCategoryListData()
}

// 重置一级分类索引和桌台列表分页
const resetOneCate = () => {
  // 重置索引
  pagingActiveIndex.value = 0
  selectDeskActiveIndex.value = -1
  // 重置分类id
  mulOpeningDesktopQuery.value.category_id = null
  // 获取桌台列表数据
  getDeskListData()
}

// 操作分页筛选对应的分类
const handleSelectPaging = (index: number, item: any) => {
  pagingActiveIndex.value = index
  mulOpeningDesktopQuery.value.category_id = item.id || null
  if (props.actionType === 'mulOpening') {
    // 获取桌台列表数据，只筛选空闲中的桌台
    getDeskListData()
  } else {
    // 多台开席回显桌台列表，多台开席调整专用，筛选全部桌台
    getDeskMultipleRecordList()
  }
}

// 判断input的聚焦事件在哪个input框上面
const onInputFocus = (event: FocusEvent, type: string, val: string) => {
  inputFocusType.value = type
  currentInputVal.value = val
}

// 清空对应的输入框
const handleClearInput = (type?: string) => {
  if (type === 'peopleKeyword') {
    peopleKeyword.value = ''
    return
  }
  if (type === 'moneyKeyword') {
    moneyKeyword.value = ''
    return
  }
  if (type === 'desktopKeyword') {
    desktopKeyword.value = ''
    return
  }
  // 清空全部输入框
  currentInputVal.value = ''
}

// 接收数字键盘传过来的关键词
const onInputKeyboard = (val: string) => {
  const type = inputFocusType.value
  if (type === 'peopleKeyword') {
    peopleKeyword.value = val
    return
  }
  if (type === 'moneyKeyword') {
    moneyKeyword.value = val
    return
  }
  if (type === 'desktopKeyword') {
    desktopKeyword.value = val
  }
}

// 表单验证
const formTestFun = (testForm: Record<string, any>) => {
  for (const key in testForm) {
    if (testForm[key] === '' || testForm[key] === null || testForm[key] === undefined) {
      ElMessage.warning(key)
      return true
    }
    if (Array.isArray(testForm[key]) && testForm[key].length === 0) {
      ElMessage.warning(key)
      return true
    }
    if (typeof testForm[key] === 'boolean' && !testForm[key]) {
      ElMessage.warning(key)
      return true
    }
  }
  return false
}

// 确认提交事件
const onConfirm = async () => {
  if (loading.value) return // 防止重复点击

  const testForm: Record<string, any> = {
    请输入人数: peopleKeyword.value,
    请输入席数: desktopKeyword.value
  }

  if (props.actionType === 'mulOpening') {
    testForm['请选择桌台'] = selectDeskActiveList.value

    // 席数只能大于等于桌台数
    testForm['席数只能大于等于桌台数'] =
      parseInt(desktopKeyword.value) >= selectDeskActiveList.value.length
  }

  // 酒席开台的结算方式才有单席金额的判断
  if (settleType.value === 10) {
    testForm['请输入单席金额'] = moneyKeyword.value
  }

  if (formTestFun(testForm)) return

  loading.value = true

  try {
    const datas: Record<string, any> = {
      use_num: peopleKeyword.value, // 使用人数
      settle_type: settleType.value, // 结算方式  10:酒席方式    20：散点方式
      open_num: desktopKeyword.value // 席数
    }

    // 多选的桌台的数组
    datas.desk_ids = selectDeskActiveList.value.map(item => {
      return item.id
    })

    // 多席开台:结算方式为10时。单席金额必填
    if (settleType.value === 10) {
      datas.money = moneyKeyword.value
    }

    if (props.actionType === 'mulOpening') {
      const res = await openMostDesk(datas)
      if (res.status === 200) {
        ElMessage.success('多席开台成功')
        // 通知父组件刷新数据
        emit('success')
        dialogVisible.value = false
      }
    } else {
      // 多席开台调整专用
      if (currentDeskDetail.value?.settle_type?.value) {
        datas.record_id =
          currentDeskDetail.value.target_record_id > 0
            ? currentDeskDetail.value.target_record_id
            : currentDeskDetail.value.id
      }

      const res = await deskEditMostDesk(datas)
      if (res.status === 200) {
        ElMessage.success('操作成功')
        // 通知父组件刷新数据
        emit('success')
        dialogVisible.value = false
      }
    }
  } catch (error) {
    console.error('多台开席操作失败:', error)
    ElMessage.error('操作失败')
  } finally {
    loading.value = false
  }
}

// 选中对应的桌台
const handleSelectTable = (index: number, datas: any) => {
  selectDeskActiveIndex.value = index
  const activeIndex = selectDeskActiveList.value.findIndex(item => item.id === datas.id)
  if (activeIndex === -1) {
    datas.isChecked = true
    selectDeskActiveList.value.push(datas)
  } else {
    datas.isChecked = false
    selectDeskActiveList.value.splice(activeIndex, 1)
  }
  // 席数只能大于等于桌台数，且选择桌台后席数自动填入对应数字
  desktopKeyword.value =
    selectDeskActiveList.value.length === 0 ? '' : String(selectDeskActiveList.value.length)
}

// 选择好了开台方式，确认开台
const handleConfirm = (val: number) => {
  settleType.value = val
  isShowDesktopType.value = false
}

// 多台开席回显桌台列表，多台开席调整专用
const getDeskMultipleRecordList = async () => {
  listLoading.value = true
  try {
    const datas = {
      record_id: currentDeskDetail.value.id,
      category_id: mulOpeningDesktopQuery.value.category_id,
      // 查询全部桌台
      is_use: 3
    }

    const res = await deskMultipleRecordList(datas)
    if (res.status === 200 && !isEmpty(res?.data)) {
      // 组装桌台列表
      const desktopArrList: any[] = []
      res.data.forEach((item: any) => {
        if (isEmpty(item.recordList)) {
          // 标记recordList为空
          item.hadRecordList = false
          desktopArrList.push(item)
        } else {
          // 标记recordList不为空
          item.hadRecordList = true
          item.recordList.forEach((record: any) => {
            const recordObj = {
              recordInfo: {
                ...record
              }
            }
            const newItem = { ...item, ...recordObj }
            desktopArrList.push(newItem)
          })
        }
      })

      desktopArrList.forEach(item => {
        if (item.check === 1) {
          item.isChecked = true
          selectDeskActiveList.value.push(item)
        } else {
          item.isChecked = false
        }
      })

      desktopIdleList.value = desktopArrList
      desktopIdleListTotal.value = desktopArrList.length
      isEmptyDesktopIdleList.value = desktopArrList.length === 0
    }
  } catch (error) {
    console.error('获取多台开席桌台列表失败:', error)
    ElMessage.error('获取多台开席桌台列表失败')
  } finally {
    listLoading.value = false
  }
}

// 重置数据
const resetData = () => {
  // 桌台分类的分页专用索引
  pagingActiveIndex.value = 0
  // 人数关键字
  peopleKeyword.value = ''
  // 单席金额关键字
  moneyKeyword.value = ''
  // 席数关键字
  desktopKeyword.value = ''
  // 桌台列表相关查询数据
  mulOpeningDesktopQuery.value = {
    // 桌台状态，只筛选空闲中的桌台
    is_use: 0,
    // 分类id
    category_id: null
  }
  // 选中对应桌台的索引下标
  selectDeskActiveIndex.value = -1
  // 桌台列表数据
  desktopIdleList.value = []
  // 桌台列表数据总条数
  desktopIdleListTotal.value = 0
  // 列表为空是否暂无数据
  isEmptyDesktopIdleList.value = false
  // 桌台分类列表
  desktopCategoryList.value = []
  // 已经选中的桌台列表
  selectDeskActiveList.value = []
  // 结算方式  10:酒席方式    20：散点方式
  settleType.value = null
  // 判断目前聚焦在哪个input输入框
  inputFocusType.value = null
  // 获取当前聚焦的input的值
  currentInputVal.value = ''
  // 桌台分类列表分页相关
  deskCategoryPageQuery.value = {
    // 一级分类的分页
    page: 1,
    limit: 4
  }
  // 判断一级分类是否还能继续下一页操作分页
  deskOneCategoryLastPage.value = 0
}

// 取消操作
const handleCancel = () => {
  dialogVisible.value = false
}

// 监听对话框打开状态
watch(
  () => dialogVisible.value,
  val => {
    if (val) {
      // 重置数据
      resetData()
      if (props.isShowType) {
        isShowDesktopType.value = true
      }
      // 获取桌台分类数据
      getCategoryListData()
      if (props.actionType === 'mulOpening') {
        // 获取桌台列表数据，只筛选空闲中的桌台
        getDeskListData()
      } else {
        // 多台开席回显桌台列表，多台开席调整专用
        getDeskMultipleRecordList()
        // 结算方式
        if (currentDeskDetail.value?.settle_type?.value) {
          settleType.value = currentDeskDetail.value.settle_type.value
          // 散点方式
          if (settleType.value === 20) {
            // 人数关键字
            peopleKeyword.value = currentDeskDetail.value.use_num
            // 席数关键字
            desktopKeyword.value = currentDeskDetail.value.open_num
          }
          // 酒席方式
          if (settleType.value === 10) {
            // 人数关键字
            peopleKeyword.value = currentDeskDetail.value.use_num
            // 席数关键字
            desktopKeyword.value = currentDeskDetail.value.open_num
            // 单席金额关键字
            moneyKeyword.value = currentDeskDetail.value.money
          }
        }
      }
    }
  }
)
</script>

<style scoped lang="scss">
.dialog-content {
  .title {
    font-size: 20px;
    font-family:
      PingFang SC,
      PingFang SC-Bold;
    font-weight: 700;
    text-align: center;
    color: #333333;
  }

  .select-box {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 50px;

    .el-select-box {
      width: 300px;
    }
  }

  .btn-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 50px;

    .cancel-btn {
      width: 190px;
      height: 60px;
      background: #ffffff;
      border: 1px solid #333333;
      border-radius: 12px;
      font-size: 18px;
      font-family:
        PingFang SC,
        PingFang SC-Regular;
      font-weight: 400;
      text-align: center;
      color: #333333;
      line-height: 60px;
      cursor: pointer;
    }

    .confirm-btn {
      width: 190px;
      height: 60px;
      background: #7c0a03;
      border-radius: 12px;
      font-size: 18px;
      font-family:
        PingFang SC,
        PingFang SC-Regular;
      font-weight: 400;
      text-align: center;
      color: #ffffff;
      line-height: 60px;
      cursor: pointer;
    }
  }
}

.mulOpeningDesktopDialog-box {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  .left-box {
    width: 720px;
    box-sizing: border-box;

    .title {
      font-size: 20px;
      font-family:
        PingFang SC,
        PingFang SC-Bold;
      font-weight: 700;
      color: #333333;
    }

    .paging-list-box {
      position: relative;
      box-sizing: border-box;
      width: 700px;
      height: 48px;
      background: #ffffff;
      border: 1px solid #d0d0d0;
      border-radius: 25px;
      display: flex;
      align-items: center;
      margin-top: 30px;

      .paging-list-item {
        display: inline-block;
        padding: 0 30px;
        height: 48px;
        line-height: 48px;
        font-size: 16px;
        font-family:
          PingFang SC,
          PingFang SC-Regular;
        font-weight: 400;
        text-align: center;
        color: #333333;
        cursor: pointer;

        .name {
          max-width: 60px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      }

      .paging-list-item-active {
        color: #ffffff;
        background: #7c0a03;
        border-radius: 24px;
      }

      .paging-list-btn {
        position: absolute;
        top: 12px;
        right: 16px;
        display: flex;
        align-items: center;

        .left-btn,
        .right-btn {
          flex-shrink: 0;
          cursor: pointer;
        }

        .left-btn {
          margin-right: 20px;
        }
      }
    }

    .room-content-box {
      padding: 0 24px 20px 24px;
      box-sizing: border-box;
      height: 690px;
      overflow-y: auto;
      background: #f4f4f4;
      margin-top: 30px;

      .room-scroll-list {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        justify-content: space-between;

        .scroll-list-item {
          position: relative;
          width: 208px;
          height: 203px;
          box-sizing: border-box;
          background: #ffffff;
          border: 1px solid #d2d2d2;
          border-top: none;
          border-radius: 12px;
          margin-top: 20px;
          cursor: pointer;

          .title-box {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 44px;
            background: #d2d2d2;
            padding: 0 12px;
            font-size: 14px;
            font-family:
              PingFang SC,
              PingFang SC-Bold;
            font-weight: 700;
            color: #ffffff;
            border-radius: 12px 12px 0px 0px;
          }

          .desc-box {
            padding: 10px 0 0 12px;

            .numberAndTag {
              display: flex;
              align-items: flex-start;

              .number {
                max-width: 200px;
                white-space: nowrap;
                text-overflow: ellipsis;
                overflow: hidden;
                font-size: 36px;
                font-family:
                  PingFang SC,
                  PingFang SC-Bold;
                font-weight: 700;
                color: #434447;
              }

              .tag {
                display: inline-block;
                padding: 0 10px;
                height: 20px;
                line-height: 20px;
                background: #cba699;
                border-radius: 10px 10px 10px 0px;
                font-size: 14px;
                font-family:
                  PingFang SC,
                  PingFang SC-Bold;
                font-weight: 700;
                text-align: center;
                color: #ffffff;
              }
            }

            .price {
              margin-top: 30px;
              font-size: 18px;
              font-family:
                PingFang SC,
                PingFang SC-Bold;
              font-weight: 700;
              color: #384148;
            }

            .time1 {
              margin-top: 15px;
              font-size: 14px;
              font-family:
                PingFang SC,
                PingFang SC-Regular;
              font-weight: 400;
              text-align: left;
              color: #333333;
            }

            .time2 {
              display: flex;
              align-items: center;
              font-size: 14px;
              font-family:
                PingFang SC,
                PingFang SC-Regular;
              font-weight: 400;
              color: #333333;
              margin-top: 6px;

              > div {
                margin-right: 10px;
              }
            }
          }
        }

        .choose-img {
          position: absolute;
          right: 12px;
          bottom: 12px;
          width: 24px;
          height: 24px;
          color: #7c0a03;
          font-size: 24px;
        }
      }

      .room-scroll-list::after {
        content: '';
        width: 208px;
      }
    }

    //滚动条整体的大小
    .room-content-box::-webkit-scrollbar {
      width: 6px !important;
      height: 0 !important;
    }

    //滚动条里滑动的滑块
    .room-content-box::-webkit-scrollbar-thumb {
      height: 200px !important;
      background: #d2d2d2 !important;
      border-radius: 3px !important;
    }

    //滚动条底层样式
    .room-content-box::-webkit-scrollbar-track {
      display: none !important;
    }

    .count-choose-box {
      height: 60px;
      padding-left: 20px;
      box-sizing: border-box;
      background: #f4f4f4;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      font-size: 14px;
      font-family:
        PingFang SC,
        PingFang SC-Regular;
      font-weight: 400;
      color: #333333;
    }
  }

  .right-box {
    width: 590px;
    box-sizing: border-box;
    margin-left: 50px;
  }

  .title {
    padding-left: 24px;
    padding-top: 7px;
    font-size: 18px;
    font-family:
      PingFang SC,
      PingFang SC-Bold;
    font-weight: 700;
    text-align: left;
    color: #333333;
    margin-bottom: 20px;
  }

  .desktop-form-box {
    width: 590px;
    height: 834px;
    box-sizing: border-box;
    border: 1px solid #d2d2d2;
    border-radius: 12px;

    .room-selected-box {
      border-radius: 12px 12px 0 0;
      padding: 0 20px 20px 20px;
      box-sizing: border-box;
      height: 211px;
      overflow-y: auto;
      background: #f4f4f4;

      .room-selected-scroll-list {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        justify-content: space-between;

        .scroll-selected-list-item {
          position: relative;
          width: 167px;
          height: 161px;
          background: #fff;
          border: 1px solid #d2d2d2;
          border-radius: 12px;
          box-sizing: border-box;
          border-top: none;
          margin-top: 20px;
          cursor: pointer;

          .title-box {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 35px;
            background: #d2d2d2;
            padding: 0 12px;
            font-size: 10px;
            font-family:
              PingFang SC,
              PingFang SC-Bold;
            font-weight: 700;
            color: #ffffff;
            border-radius: 12px 12px 0px 0px;
          }

          .desc-box {
            padding: 6px 0 0 8px;

            .numberAndTag {
              display: flex;
              align-items: flex-start;

              .number {
                max-width: 160px;
                white-space: nowrap;
                text-overflow: ellipsis;
                overflow: hidden;
                font-size: 25px;
                font-family:
                  PingFang SC,
                  PingFang SC-Bold;
                font-weight: 700;
                color: #434447;
              }

              .tag {
                display: inline-block;
                padding: 0 10px;
                height: 20px;
                line-height: 20px;
                background: #cba699;
                border-radius: 10px 10px 10px 0px;
                font-size: 14px;
                font-family:
                  PingFang SC,
                  PingFang SC-Bold;
                font-weight: 700;
                text-align: center;
                color: #ffffff;
                margin-left: 4px;
              }
            }
          }
        }
      }

      .room-selected-scroll-list::after {
        content: '';
        width: 167px;
      }
    }

    //滚动条整体的大小
    .room-selected-box::-webkit-scrollbar {
      width: 6px !important;
      height: 0 !important;
    }

    //滚动条里滑动的滑块
    .room-selected-box::-webkit-scrollbar-thumb {
      height: 200px !important;
      background: #d2d2d2 !important;
      border-radius: 3px !important;
    }

    //滚动条底层样式
    .room-selected-box::-webkit-scrollbar-track {
      display: none !important;
    }

    .count-selected-box {
      height: 62px;
      padding-left: 20px;
      box-sizing: border-box;
      background: #f4f4f4;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      font-size: 16px;
      font-family:
        PingFang SC,
        PingFang SC-Regular;
      font-weight: 400;
      color: #333333;
    }

    .form-input-box {
      padding: 0 24px 20px 24px;

      .form-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 20px;

        .desc {
          font-size: 18px;
          font-family:
            PingFang SC,
            PingFang SC-Regular;
          font-weight: 400;
          color: #333333;
        }

        .dialog-input {
          width: 422px;
          height: 48px;
          background: #ffffff;
          border: 1px solid #d2d2d2;
          border-radius: 12px;
          box-sizing: border-box;
          padding: 0 20px;
          display: flex;
          align-items: center;
          justify-content: space-between;

          .input {
            width: 400px;
            font-size: 14px;
            font-family:
              PingFang SC,
              PingFang SC-Regular;
            font-weight: 400;
            text-align: left;
            color: #333333;
            outline: none;
            border: none;
          }

          .image {
            flex-shrink: 0;
            width: 24px;
            height: 24px;
            cursor: pointer;
            color: #999;
          }
        }
      }
    }

    .number-keyword-box {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 330px;
      background: #ffffff;
      border-radius: 0px 0px 12px 12px;
      box-shadow: 0px -3px 6px 0px rgba(0, 0, 0, 0.04);
      box-sizing: border-box;
    }
  }
}

.no-data-box {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 170px;
  margin-top: 250px;
}

.no-data-box-two {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 170px;
  margin-top: 20px;
}
</style>
